﻿using WoodAdmin.Models;
using WoodAdmin.Repository;
using SqlSugar;
using System;
using System.Collections.Generic;
using System.Linq;

namespace WoodAdmin.Services
{
	public class SysUserRoleService : BaseService<SysUserRole>
	{

        /// <summary>
        /// 当前用户的所有角色ID
        /// </summary>
        /// <param name="userid"></param>
        /// <returns></returns>

        public List<int> CurrentUserRoles(int userid)
        {
            return Queryable(r => r.UserID == userid).Select(r => r.RoleID).ToList();
        }
    }
}